<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改list')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-sale-edit" th:object="${sale}">
        <input name="sId" th:field="*{sId}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label">销售名称：</label>
            <div class="col-sm-8">
                <input name="sName" th:field="*{sName}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">处理人：</label>
            <div class="col-sm-8">
                <select class="form-control" th:with="uIds=${@sale.selectUserList()}" th:field="*{uId}" name="uId" id="uId"  required >
                    <option value="">请选择处理人</option>
                    <option th:each="c : ${uIds}" th:text="${c.userName}" th:value="${c.userId}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">客户名称：</label>
            <div class="col-sm-8">
                <select class="form-control" th:with="cIds=${@sale.selectClientList()}" th:field="*{cId}" name="cId" id="cId"  required >
                    <option value="">请选择客户</option>
                    <option th:each="c : ${cIds}" th:text="${c.cname}" th:value="${c.cid}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">销售时间：</label>
            <div class="col-sm-8">
                <input name="saleTime" th:field="*{saleTime}" class="time-input" type="text">
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
    var prefix = ctx + "cms/sale";
    $("#form-sale-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-sale-edit').serialize());
        }
    }
</script>
</body>
</html>